﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.SubMeshDescriptor
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

#nullable disable
namespace UnityEngine.Rendering
{
  /// <summary>
  ///   <para>Contains information about a single sub-mesh of a Mesh.</para>
  /// </summary>
  /// <summary>
  ///   <para>Create a submesh descriptor.</para>
  /// </summary>
  /// <param name="indexStart">Initial value for indexStart field.</param>
  /// <param name="indexCount">Initial value for indexCount field.</param>
  /// <param name="topology">Initial value for topology field.</param>
  public struct SubMeshDescriptor(int indexStart, int indexCount, MeshTopology topology = MeshTopology.Triangles)
  {
    /// <summary>
    ///   <para>Bounding box of vertices in local space.</para>
    /// </summary>
    public Bounds bounds { get; set; } = new Bounds();

    /// <summary>
    ///   <para>Face topology of this sub-mesh.</para>
    /// </summary>
    public MeshTopology topology { get; set; } = topology;

    /// <summary>
    ///   <para>Starting point inside the whole Mesh index buffer where the face index data is found.</para>
    /// </summary>
    public int indexStart { get; set; } = indexStart;

    /// <summary>
    ///   <para>Index count for this sub-mesh face data.</para>
    /// </summary>
    public int indexCount { get; set; } = indexCount;

    /// <summary>
    ///   <para>Offset that is added to each value in the index buffer, to compute the final vertex index.</para>
    /// </summary>
    public int baseVertex { get; set; } = 0;

    /// <summary>
    ///   <para>First vertex in the index buffer for this sub-mesh.</para>
    /// </summary>
    public int firstVertex { get; set; } = 0;

    /// <summary>
    ///   <para>Number of vertices used by the index buffer of this sub-mesh.</para>
    /// </summary>
    public int vertexCount { get; set; } = 0;

    public override string ToString()
    {
      return string.Format("(topo={0} indices={1},{2} vertices={3},{4} basevtx={5} bounds={6})", (object) this.topology, (object) this.indexStart, (object) this.indexCount, (object) this.firstVertex, (object) this.vertexCount, (object) this.baseVertex, (object) this.bounds);
    }
  }
}
